import React, { useContext } from 'react'
import { View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import './mine.less'
import { UserContext } from "../../app";

const Mine = () => {
  const toOrdersPage = (status) => {
    Taro.navigateTo({
      url: `/pages/orders/orders?status=${status}`
    })
  }
  const { user } = useContext(UserContext)

  return (
    <View className='base'>
      <View className='box'>
        <View className='flex-row'>
          <View>[image]</View>
          <View>
            <View>蛋蛋妈妈</View>
            <View>男孩7个月18天</View>
          </View>
          <View>&gt;</View>
        </View>
      </View>
      <View>
        <View>我的金币：{user.points}金币</View>
        <View>去兑换&gt;</View>
      </View>

      <View className='box'>[广电妈妈卡]</View>
      <View className='box flex-row'>
        <View onClick={() => toOrdersPage('notPaid')}>
          <View>[image]</View>
          <View>待核销</View>
        </View>
        <View onClick={() => toOrdersPage(2)}>
          <View>[image]</View>
          <View>待发货</View>
        </View>
        <View onClick={() => toOrdersPage(3)}>
          <View>[image]</View>
          <View>已完成</View>
        </View>
        <View onClick={() => toOrdersPage('ALL')}>
          <View>[image]</View>
          <View>全部订单</View>
        </View>
      </View>
      <View className='box'>
        <View className='flex-row'>
          <View>[image]我的小票</View>
          <View>&gt;</View>
        </View>
        <View className='flex-row'>
          <View>[image]系统消息</View>
          <View>&gt;</View>
        </View>
        <View className='flex-row'>
          <View>[image]关于我们</View>
          <View>&gt;</View>
        </View>
        <View className='flex-row'>
          <View>[image]联系客服</View>
          <View>&gt;</View>
        </View>


      </View>

    </View>
  )
}

export default Mine
